<template>
	<view class="wrapper">
		<myheader type="2"></myheader>
		<scroll-view scroll-y="true" class="main" @scrolltolower="loadMore">
			<div class="table f26">
				<uni-table :border="false" emptyText="暂无更多数据">
					<!-- 表头行 -->
					<uni-tr>
						<uni-th>类型</uni-th>
						<uni-th>数量</uni-th>
						<uni-th>时间</uni-th>
					</uni-tr>
					<!-- 表格数据行 -->
					<uni-tr v-for="v in list" :key="v.id">
						<uni-td>{{v.memo}}</uni-td>
						<uni-td>{{v.money}}</uni-td>
						<uni-td>{{timestampToTime(v.createtime*1000)}}</uni-td>
					</uni-tr>
				</uni-table>
			</div>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				 type:'',
				 page:1,
				 pagesize:20,
				 list:[]
			};
		},
		onLoad(e){
			console.log(e)
			this.type=e.type
			this.getwater()
		},
		methods:{
			loadMore(){
				this.page++
				this.getwater()
			},
			// 获取流水
			getwater(){
				this.$http('/user/water',{
					type:this.type,
					page:this.page,
					pagesize:this.pagesize
				}).then(r=>{
					this.list=this.list.concat(r.data)
					console.log(r)
				})
			}
		}
		
	}
</script>

<style lang="scss">
	.table {
		margin: 20rpx;
		.uni-table-td{
			font-size: 24rpx;
		}
	}
</style>